<template>
  <div>
    <input type="button" @click="addItem" value="add" />
    <div v-for="item in data.a" :key="item.id">
       {{item.id}} | {{item.name}} | {{item.age}} <br/>
       <input type="text" v-model="item.name"/>
       <input type="text" v-model="item.age"/>
       <a-input v-model="item.name" style="width:100px"/>
    </div>
<hr/>
<div v-for="item in data.a" :key="item.id">
      <ArrayTestChild2 :item="item" ></ArrayTestChild2>
    </div>

    
  </div>
</template>

<script>
import ArrayTestChild2 from './ArrayTestChild2.vue'
export default {
  components:{ArrayTestChild2},
    props:["data","add"],
   
  methods: {
    addItem: function() {
      this.add({id:Math.random()});
    }
  }
};
</script>

<style></style>
